#include "loginwindow.h"

LoginWindow::LoginWindow(QWidget *parent) : QWidget(parent)
{
    //初始化窗口
    initWindow();
}

// ctrl + i 对齐 缩进
// ctrl + / 注释
void LoginWindow::initWindow()
{
    //改变窗口大小
    resize(800,600);
    //实例化按钮对象 &c 快捷键 按下 alt+c
    button = new QPushButton(
                QIcon("E:\\share\\12class\\C++\\qt\\empty\\img\\luobo.webp"),
                "关闭(&C)",this);
    connect(button,SIGNAL(clicked(bool)),this,SLOT(close()));
    //设置按钮上图标的大小
    button->setIconSize(QSize(100,100));
    openButton = new QPushButton("打开",this);
    //设置按钮图标
    openButton->setIcon(QIcon("../empty/img/luobo.webp"));

    openButton->move(100,100);

    toolBtn = new QToolButton(this);
    toolBtn->setText("工具");
    toolBtn->setIcon(QIcon("../empty/img/luobo.webp"));
    toolBtn->setGeometry(300,0,100,100);
    toolBtn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);

    gBox = new QGroupBox("复选",this);
    gBox->move(0,200);

    genderBox = new QGroupBox("单选",this);
    genderBox->move(300,100);

    cBox = new QCheckBox("abc",gBox);
    cBox->move(0,300);
    //是否为选中的状态
    //    cBox->setChecked(true);
    cBox->setCheckState(Qt::Checked);

    rButton1 = new QRadioButton("男",genderBox);
    rButton2 = new QRadioButton("女",genderBox);
    rButton1->move(10,10);
    rButton2->move(10,40);
}
